“Filtering” is one of the most basic operations in the field of signal processing. Through filtering, various operations are performed on either analog or digital signals to achieve results such as noise suppression, data compaction, and feature enhancement. A filter may be a physical object such as an electrical or electronic circuit on a signal's path, or a set of mathematical manipulations performed on different aspects of a signal such as its magnitude or phase, or it may be any other (usually nonrandom) operation performed on a signal.
One branch of signal processing is image processing. A digital image is a collection of points with different brightness and colors, called pixels, which are of finite physical dimensions. To store or transmit images, the data corresponding to each pixel represents the pixel's color, brightness, luminance, and other information associated with the pixel. This image data is susceptible to corruption and noise as a result of data transmission, physical limitations of image capturing and storing devices, electromagnetic interference, etc. To compensate for damage caused to the image data and consequent image degradation, and to reduce the noise and smooth the corrupted image, or merely to enhance the image and emphasize its features, it may be desirable to perform some operations on an image through filtering.
Some traditional but more complicated and often computationally more demanding operations involve transformation of the image data into other domains, such as the Fourier, Hankel, or Hilbert domains, and an inverse transformation to the image domain subsequent to some manipulations in the new domains. Other traditional methods involve mathematical manipulations in the same domain as the image domain. A typical example of the latter methods is to adjust each pixel data using the data corresponding to its neighboring pixels. The selection criteria for choosing the neighboring pixels and the computational scheme for adjustment of a target pixel's data are some of the distinguishing attributes of a filter.
A number of more popular filters calculate some variations of a weighted average value of a pixel and its neighbors. In these filters the value of the pixel data to be adjusted (target pixel), and its neighbors' data, is usually multiplied by fixed numbers (weights), and the average value of the resulting multiplications is used to adjust the target pixel. In effect the image is “convolved” with a two-dimensional window of multipliers.
In an image, apart from exceptional cases, there is a high probability that the value of each pixel data is close to the values of its neighbors. Accordingly, an averaging scheme such as the one described above reduces the corrupting effect of noise by bringing a noise-affected pixel's value closer to the values of its neighbors. However, while averaging schemes “smooth” the image by suppressing noise, they blur the “edges” of any object within the image by preventing any sudden change in pixel values and replacing sudden changes by gradual ones.
A need exists for relatively simple yet adaptable filters, which can adjust their weights based on the local necessities of an image and preserve the edges and the image sharpness while enhancing the image and reducing the noise.